﻿@using Windvoice.Blog;
@{
    ViewBag.Title = "Category Index";
    Layout = "~/Areas/Manage/Views/Shared/_Layout.cshtml";
}

@section headSection{
    <script type="text/javascript">
        $(function () {
            $('a[data-delete]').click(function () { $(this).handledelete('/manage/category/delete') });
        });
    </script>
}

<div class="pagetitle">
    <h2>日志分类</h2>
    <div class="pagefunctions">
        <a href="/manage/category/create">创建分类</a>
    </div>
</div>


<ul class="category-list">
    @foreach (var category in (IList<Category>)ViewBag.CategoryList)
    {
        <li>
            <div class="title">
                <h5>@category.Name</h5>
                <div class="operate">
                    <a href="/manage/category/edit/@category.ID">编辑</a>
                    <a href="javascript:;" data-delete="@category.ID">删除</a>
                </div>
            </div>
            <div class="content">
                @category.Description
            </div>      
        </li> 
    }
</ul>